package com.zengdb.mybatis.service.impl;

import org.apache.ibatis.session.SqlSession;

import com.zengdb.mybatis.dao.QQZoneMapper;
import com.zengdb.mybatis.domain.QQZone;
import com.zengdb.mybatis.service.IQQZoneService;
import com.zengdb.mybatis.util.MyBatisUtil;

public class QQZoneServiceImpl implements IQQZoneService{

	@Override
	public void saveOne(QQZone zone) {
		//获取SqlSession对象
		SqlSession session = MyBatisUtil.openSession();
		QQZoneMapper dao = session.getMapper(QQZoneMapper.class);
		
		//调用dao层的方法
		dao.saveOne(zone);
		
		//提交事务
		session.commit();
		
		//释放资源
		session.close();
	}

}
